package com.gagakuai.bpm.config.busniess;

import com.gagakuai.bpm.domian.dto.response.ResponseStatusDto;
import com.gagakuai.bpm.rpcservice.openfeign.UserHttpApi;
import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


/*
 * 更新危险源信息到正式表
 */

@Slf4j
@Component
public class UpdateHazardInformation implements JavaDelegate {

    @Resource
    private UserHttpApi userHttpApi;

    @Override
    public void execute(DelegateExecution execution)  {
        ResponseStatusDto<Void> responseStatusDto = userHttpApi.updateProcId(execution.getBusinessKey());
        log.info("更新危险源信息到正式表：{}，{}", responseStatusDto.getCode(), responseStatusDto.getMessage());
    }
}
